/*
 * Vertex_2.vert
 */
attribute vec3 vertex_pos;
attribute vec3 vertex_norm;
attribute float vertex_material;

uniform vec3 offset;
uniform float scale;
uniform mat4 rotation;

varying vec3 out_norm;
varying vec3 out_pos;
varying float out_material;

void main(void)
{
    vec3 v = (vertex_pos + offset)*scale;

    vec4 pos = rotation*vec4(v, 1.0);
   //+don't flip ? pos.y = -pos.y;
    pos.z = -pos.z;

    gl_Position = pos;

//    gl_Position = rotation*vec4(v, 1.0);

    out_norm = normalize(vec3(rotation*vec4(vertex_norm, 0.0)));
    out_pos = vec3(gl_Position);
    out_material = vertex_material;
}
